<?php
/**
 * Created by PhpStorm.
 * User: zhang
 * Date: 2018/1/24
 * Time: 14:00
 */


while (true){
    $now = new DateTime();
    $spring = DateTime::createFromFormat('Y-m-d H:i:s','2018-02-15 00:00:00');
    if ($spring){
        $dateInterval = $spring->diff($now);
        echo $dateInterval->format(" 还有%d天%H时%i分%s秒过年").PHP_EOL;
    }
    sleep(1);
}
